<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <script>
        // 把数组转换为字符串方法
        // 1. toString()
        var arr = [1, 2, 3, 4, 5];
        console.log(arr);
        console.log(arr.toString());
        // 2. join([分隔符]) 可以加分隔符也可以不加分隔符  重点
        var arr = [1, 2, 3, 4, 5];
        console.log(arr.join()); // 如果括号为空 等价于 toString
        console.log(arr.join('-'));
        console.log(arr.join('+'));
        console.log(arr.join('&'));
    </script>
</head>

<body>

</body>

</html>